package com.zhizhi.common.exception;

/**
 * 系统异常枚举
 * @author yyp
 * @since 2019-09-04
 */
public enum SysExceptionEnum {

    /**
     * IO异常
     */
    IO_EXCEPTION("IO异常",8023),

    /**
     * 没有找到文件异常
     */
    FILE_NOT_FOUND_EXCEPTION("没有找到文件异常",8024),

    /**
    * 空指针异常
    */
    Null_Pointer_EXCEPTION("空指针异常", 8025),

    INVALID_XML_EXCEPTION("Invalid XML", 8026),

    ORDER_DATA_EXCEPTION("订单数据异常", 8027);

    SysExceptionEnum(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    private String name;
    private Integer code;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public ServiceException getException(){
        return new ServiceException(getCode()+"",getName());
    }

}
